home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / lib / udev / check_driver < prev    next >
Text File  |  2008-10-21  |  499b  |  25 lines

  1. #!/bin/sh
  2. #
  3.  
  4. #logger check_driver called with: $1 - $2 - $3 -
  5.  
  6. wanted=$1
  7. devpath=$2
  8. bustype=$3
  9.  
  10. device=$(readlink /sys/$devpath/device)
  11. device=${device##*/}
  12. driver=$(readlink /sys/$devpath/device/driver)
  13. driver=${driver##*/}
  14.  
  15. logger device $device is bound to the $driver driver
  16.  
  17. if [ "$driver" != "$wanted" ]; then
  18.     logger must rebind
  19.     echo -n "$device" > /sys/$devpath/device/driver/unbind
  20.     echo -n "$device" > /sys/bus/$bustype/drivers/$wanted/bind
  21. else
  22.     logger no need to rebind
  23. fi
  24.  
  25.